package com.example.login.Mapper;

import com.example.login.Pojo.Goods;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.ArrayList;

@Repository
@Mapper
public interface CollectMap {
    @Insert("Insert into xtshop_collection values(#{user_id},#{good_id});")
    public void insertIntoCollection(int user_id,int good_id);

    @Select("Select id,seller_id,item_name,store_name,brand_name,goodImage,cid,fright," +
            "goodStatus,sell_num,min_price from xtshop_goods natural join xtshop_collection where user_id=" +
            "#{user_id}")
    public ArrayList<Goods> getGoods(int user_id);
}
